﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace WoogiUI
{
    public static class UGUIEx
    {
        public static RectTransform GetRectTransform(this GameObject t)
        {
            if (t != null)
            {
                return t.GetComponent<RectTransform>();
            }
            return null;
        }

        public static void SetActive(this GameObject t,bool isActive)
        {
            if (t != null)
            {
                if (t.activeSelf != isActive)
                    t.SetActive(isActive);
            }
        }

        public static bool GetActiveSelf(this GameObject t)
        {
            if (t != null)
            {
                return t.activeSelf;
            }
            return false;
        }
    }
}
